using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class HRM_TIMEKEEPER_OVERTIMEData : DatabaseObjectBase
	{
		public HRM_TIMEKEEPER_OVERTIMEData()
		{
			Initialize(true);
		}
		public HRM_TIMEKEEPER_OVERTIMEData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 HRM_TIMEKEEPER_OVERTIME_Insert(Guid TimeKeeperTableListID, String EmployeeCode, String D1, String D2, String D3, String D4, String D5, String D6, String D7, String D8, String D9, String D10, String D11, String D12, String D13, String D14, String D15, String D16, String D17, String D18, String D19, String D20, String D21, String D22, String D23, String D24, String D25, String D26, String D27, String D28, String D29, String D30, String D31, Double Total)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@TimeKeeperTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D1", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D2", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D3", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D4", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D5", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D6", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D7", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D8", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D9", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D10", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D11", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D12", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D13", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D14", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D15", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D16", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D17", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D18", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D19", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D20", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D21", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D22", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D23", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D24", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D25", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D26", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D27", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D28", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D29", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D30", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@D31", SqlDbType.VarChar, 50));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Total", SqlDbType.Float));
				_dbadapter.InsertCommand.Prepare();
				SqlGuid TimeKeeperTableListIDSQL = TimeKeeperTableListID;
				_dbadapter.InsertCommand.Parameters["@TimeKeeperTableListID"].Value = TimeKeeperTableListIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.InsertCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				SqlString D1SQL = D1;
				_dbadapter.InsertCommand.Parameters["@D1"].Value = D1SQL;
				SqlString D2SQL = D2;
				_dbadapter.InsertCommand.Parameters["@D2"].Value = D2SQL;
				SqlString D3SQL = D3;
				_dbadapter.InsertCommand.Parameters["@D3"].Value = D3SQL;
				SqlString D4SQL = D4;
				_dbadapter.InsertCommand.Parameters["@D4"].Value = D4SQL;
				SqlString D5SQL = D5;
				_dbadapter.InsertCommand.Parameters["@D5"].Value = D5SQL;
				SqlString D6SQL = D6;
				_dbadapter.InsertCommand.Parameters["@D6"].Value = D6SQL;
				SqlString D7SQL = D7;
				_dbadapter.InsertCommand.Parameters["@D7"].Value = D7SQL;
				SqlString D8SQL = D8;
				_dbadapter.InsertCommand.Parameters["@D8"].Value = D8SQL;
				SqlString D9SQL = D9;
				_dbadapter.InsertCommand.Parameters["@D9"].Value = D9SQL;
				SqlString D10SQL = D10;
				_dbadapter.InsertCommand.Parameters["@D10"].Value = D10SQL;
				SqlString D11SQL = D11;
				_dbadapter.InsertCommand.Parameters["@D11"].Value = D11SQL;
				SqlString D12SQL = D12;
				_dbadapter.InsertCommand.Parameters["@D12"].Value = D12SQL;
				SqlString D13SQL = D13;
				_dbadapter.InsertCommand.Parameters["@D13"].Value = D13SQL;
				SqlString D14SQL = D14;
				_dbadapter.InsertCommand.Parameters["@D14"].Value = D14SQL;
				SqlString D15SQL = D15;
				_dbadapter.InsertCommand.Parameters["@D15"].Value = D15SQL;
				SqlString D16SQL = D16;
				_dbadapter.InsertCommand.Parameters["@D16"].Value = D16SQL;
				SqlString D17SQL = D17;
				_dbadapter.InsertCommand.Parameters["@D17"].Value = D17SQL;
				SqlString D18SQL = D18;
				_dbadapter.InsertCommand.Parameters["@D18"].Value = D18SQL;
				SqlString D19SQL = D19;
				_dbadapter.InsertCommand.Parameters["@D19"].Value = D19SQL;
				SqlString D20SQL = D20;
				_dbadapter.InsertCommand.Parameters["@D20"].Value = D20SQL;
				SqlString D21SQL = D21;
				_dbadapter.InsertCommand.Parameters["@D21"].Value = D21SQL;
				SqlString D22SQL = D22;
				_dbadapter.InsertCommand.Parameters["@D22"].Value = D22SQL;
				SqlString D23SQL = D23;
				_dbadapter.InsertCommand.Parameters["@D23"].Value = D23SQL;
				SqlString D24SQL = D24;
				_dbadapter.InsertCommand.Parameters["@D24"].Value = D24SQL;
				SqlString D25SQL = D25;
				_dbadapter.InsertCommand.Parameters["@D25"].Value = D25SQL;
				SqlString D26SQL = D26;
				_dbadapter.InsertCommand.Parameters["@D26"].Value = D26SQL;
				SqlString D27SQL = D27;
				_dbadapter.InsertCommand.Parameters["@D27"].Value = D27SQL;
				SqlString D28SQL = D28;
				_dbadapter.InsertCommand.Parameters["@D28"].Value = D28SQL;
				SqlString D29SQL = D29;
				_dbadapter.InsertCommand.Parameters["@D29"].Value = D29SQL;
				SqlString D30SQL = D30;
				_dbadapter.InsertCommand.Parameters["@D30"].Value = D30SQL;
				SqlString D31SQL = D31;
				_dbadapter.InsertCommand.Parameters["@D31"].Value = D31SQL;
				SqlDouble TotalSQL = Total;
				_dbadapter.InsertCommand.Parameters["@Total"].Value = TotalSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TIMEKEEPER_OVERTIME_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TIMEKEEPER_OVERTIME_Update(Guid TimeKeeperTableListID, String EmployeeCode, String D1, String D2, String D3, String D4, String D5, String D6, String D7, String D8, String D9, String D10, String D11, String D12, String D13, String D14, String D15, String D16, String D17, String D18, String D19, String D20, String D21, String D22, String D23, String D24, String D25, String D26, String D27, String D28, String D29, String D30, String D31, Double Total)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TimeKeeperTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D1", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D2", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D3", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D4", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D5", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D6", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D7", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D8", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D9", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D10", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D11", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D12", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D13", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D14", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D15", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D16", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D17", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D18", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D19", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D20", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D21", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D22", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D23", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D24", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D25", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D26", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D27", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D28", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D29", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D30", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D31", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Total", SqlDbType.Float));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid TimeKeeperTableListIDSQL = TimeKeeperTableListID;
				_dbadapter.UpdateCommand.Parameters["@TimeKeeperTableListID"].Value = TimeKeeperTableListIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.UpdateCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				SqlString D1SQL = D1;
				_dbadapter.UpdateCommand.Parameters["@D1"].Value = D1SQL;
				SqlString D2SQL = D2;
				_dbadapter.UpdateCommand.Parameters["@D2"].Value = D2SQL;
				SqlString D3SQL = D3;
				_dbadapter.UpdateCommand.Parameters["@D3"].Value = D3SQL;
				SqlString D4SQL = D4;
				_dbadapter.UpdateCommand.Parameters["@D4"].Value = D4SQL;
				SqlString D5SQL = D5;
				_dbadapter.UpdateCommand.Parameters["@D5"].Value = D5SQL;
				SqlString D6SQL = D6;
				_dbadapter.UpdateCommand.Parameters["@D6"].Value = D6SQL;
				SqlString D7SQL = D7;
				_dbadapter.UpdateCommand.Parameters["@D7"].Value = D7SQL;
				SqlString D8SQL = D8;
				_dbadapter.UpdateCommand.Parameters["@D8"].Value = D8SQL;
				SqlString D9SQL = D9;
				_dbadapter.UpdateCommand.Parameters["@D9"].Value = D9SQL;
				SqlString D10SQL = D10;
				_dbadapter.UpdateCommand.Parameters["@D10"].Value = D10SQL;
				SqlString D11SQL = D11;
				_dbadapter.UpdateCommand.Parameters["@D11"].Value = D11SQL;
				SqlString D12SQL = D12;
				_dbadapter.UpdateCommand.Parameters["@D12"].Value = D12SQL;
				SqlString D13SQL = D13;
				_dbadapter.UpdateCommand.Parameters["@D13"].Value = D13SQL;
				SqlString D14SQL = D14;
				_dbadapter.UpdateCommand.Parameters["@D14"].Value = D14SQL;
				SqlString D15SQL = D15;
				_dbadapter.UpdateCommand.Parameters["@D15"].Value = D15SQL;
				SqlString D16SQL = D16;
				_dbadapter.UpdateCommand.Parameters["@D16"].Value = D16SQL;
				SqlString D17SQL = D17;
				_dbadapter.UpdateCommand.Parameters["@D17"].Value = D17SQL;
				SqlString D18SQL = D18;
				_dbadapter.UpdateCommand.Parameters["@D18"].Value = D18SQL;
				SqlString D19SQL = D19;
				_dbadapter.UpdateCommand.Parameters["@D19"].Value = D19SQL;
				SqlString D20SQL = D20;
				_dbadapter.UpdateCommand.Parameters["@D20"].Value = D20SQL;
				SqlString D21SQL = D21;
				_dbadapter.UpdateCommand.Parameters["@D21"].Value = D21SQL;
				SqlString D22SQL = D22;
				_dbadapter.UpdateCommand.Parameters["@D22"].Value = D22SQL;
				SqlString D23SQL = D23;
				_dbadapter.UpdateCommand.Parameters["@D23"].Value = D23SQL;
				SqlString D24SQL = D24;
				_dbadapter.UpdateCommand.Parameters["@D24"].Value = D24SQL;
				SqlString D25SQL = D25;
				_dbadapter.UpdateCommand.Parameters["@D25"].Value = D25SQL;
				SqlString D26SQL = D26;
				_dbadapter.UpdateCommand.Parameters["@D26"].Value = D26SQL;
				SqlString D27SQL = D27;
				_dbadapter.UpdateCommand.Parameters["@D27"].Value = D27SQL;
				SqlString D28SQL = D28;
				_dbadapter.UpdateCommand.Parameters["@D28"].Value = D28SQL;
				SqlString D29SQL = D29;
				_dbadapter.UpdateCommand.Parameters["@D29"].Value = D29SQL;
				SqlString D30SQL = D30;
				_dbadapter.UpdateCommand.Parameters["@D30"].Value = D30SQL;
				SqlString D31SQL = D31;
				_dbadapter.UpdateCommand.Parameters["@D31"].Value = D31SQL;
				SqlDouble TotalSQL = Total;
				_dbadapter.UpdateCommand.Parameters["@Total"].Value = TotalSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TIMEKEEPER_OVERTIME_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TIMEKEEPER_OVERTIME_Disable(Guid TimeKeeperTableListID, String EmployeeCode, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TimeKeeperTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid TimeKeeperTableListIDSQL = TimeKeeperTableListID;
				_dbadapter.UpdateCommand.Parameters["@TimeKeeperTableListID"].Value = TimeKeeperTableListIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.UpdateCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TIMEKEEPER_OVERTIME_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TIMEKEEPER_OVERTIME_Delete(Guid TimeKeeperTableListID, String EmployeeCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@TimeKeeperTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.DeleteCommand.Prepare();
				SqlGuid TimeKeeperTableListIDSQL = TimeKeeperTableListID;
				_dbadapter.DeleteCommand.Parameters["@TimeKeeperTableListID"].Value = TimeKeeperTableListIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.DeleteCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TIMEKEEPER_OVERTIME_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TIMEKEEPER_OVERTIME_Save(Guid TimeKeeperTableListID, String EmployeeCode, String D1, String D2, String D3, String D4, String D5, String D6, String D7, String D8, String D9, String D10, String D11, String D12, String D13, String D14, String D15, String D16, String D17, String D18, String D19, String D20, String D21, String D22, String D23, String D24, String D25, String D26, String D27, String D28, String D29, String D30, String D31, Double Total)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TimeKeeperTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D1", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D2", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D3", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D4", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D5", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D6", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D7", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D8", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D9", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D10", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D11", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D12", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D13", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D14", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D15", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D16", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D17", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D18", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D19", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D20", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D21", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D22", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D23", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D24", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D25", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D26", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D27", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D28", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D29", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D30", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@D31", SqlDbType.VarChar, 50));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Total", SqlDbType.Float));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid TimeKeeperTableListIDSQL = TimeKeeperTableListID;
				_dbadapter.UpdateCommand.Parameters["@TimeKeeperTableListID"].Value = TimeKeeperTableListIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.UpdateCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				SqlString D1SQL = D1;
				_dbadapter.UpdateCommand.Parameters["@D1"].Value = D1SQL;
				SqlString D2SQL = D2;
				_dbadapter.UpdateCommand.Parameters["@D2"].Value = D2SQL;
				SqlString D3SQL = D3;
				_dbadapter.UpdateCommand.Parameters["@D3"].Value = D3SQL;
				SqlString D4SQL = D4;
				_dbadapter.UpdateCommand.Parameters["@D4"].Value = D4SQL;
				SqlString D5SQL = D5;
				_dbadapter.UpdateCommand.Parameters["@D5"].Value = D5SQL;
				SqlString D6SQL = D6;
				_dbadapter.UpdateCommand.Parameters["@D6"].Value = D6SQL;
				SqlString D7SQL = D7;
				_dbadapter.UpdateCommand.Parameters["@D7"].Value = D7SQL;
				SqlString D8SQL = D8;
				_dbadapter.UpdateCommand.Parameters["@D8"].Value = D8SQL;
				SqlString D9SQL = D9;
				_dbadapter.UpdateCommand.Parameters["@D9"].Value = D9SQL;
				SqlString D10SQL = D10;
				_dbadapter.UpdateCommand.Parameters["@D10"].Value = D10SQL;
				SqlString D11SQL = D11;
				_dbadapter.UpdateCommand.Parameters["@D11"].Value = D11SQL;
				SqlString D12SQL = D12;
				_dbadapter.UpdateCommand.Parameters["@D12"].Value = D12SQL;
				SqlString D13SQL = D13;
				_dbadapter.UpdateCommand.Parameters["@D13"].Value = D13SQL;
				SqlString D14SQL = D14;
				_dbadapter.UpdateCommand.Parameters["@D14"].Value = D14SQL;
				SqlString D15SQL = D15;
				_dbadapter.UpdateCommand.Parameters["@D15"].Value = D15SQL;
				SqlString D16SQL = D16;
				_dbadapter.UpdateCommand.Parameters["@D16"].Value = D16SQL;
				SqlString D17SQL = D17;
				_dbadapter.UpdateCommand.Parameters["@D17"].Value = D17SQL;
				SqlString D18SQL = D18;
				_dbadapter.UpdateCommand.Parameters["@D18"].Value = D18SQL;
				SqlString D19SQL = D19;
				_dbadapter.UpdateCommand.Parameters["@D19"].Value = D19SQL;
				SqlString D20SQL = D20;
				_dbadapter.UpdateCommand.Parameters["@D20"].Value = D20SQL;
				SqlString D21SQL = D21;
				_dbadapter.UpdateCommand.Parameters["@D21"].Value = D21SQL;
				SqlString D22SQL = D22;
				_dbadapter.UpdateCommand.Parameters["@D22"].Value = D22SQL;
				SqlString D23SQL = D23;
				_dbadapter.UpdateCommand.Parameters["@D23"].Value = D23SQL;
				SqlString D24SQL = D24;
				_dbadapter.UpdateCommand.Parameters["@D24"].Value = D24SQL;
				SqlString D25SQL = D25;
				_dbadapter.UpdateCommand.Parameters["@D25"].Value = D25SQL;
				SqlString D26SQL = D26;
				_dbadapter.UpdateCommand.Parameters["@D26"].Value = D26SQL;
				SqlString D27SQL = D27;
				_dbadapter.UpdateCommand.Parameters["@D27"].Value = D27SQL;
				SqlString D28SQL = D28;
				_dbadapter.UpdateCommand.Parameters["@D28"].Value = D28SQL;
				SqlString D29SQL = D29;
				_dbadapter.UpdateCommand.Parameters["@D29"].Value = D29SQL;
				SqlString D30SQL = D30;
				_dbadapter.UpdateCommand.Parameters["@D30"].Value = D30SQL;
				SqlString D31SQL = D31;
				_dbadapter.UpdateCommand.Parameters["@D31"].Value = D31SQL;
				SqlDouble TotalSQL = Total;
				_dbadapter.UpdateCommand.Parameters["@Total"].Value = TotalSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TIMEKEEPER_OVERTIME_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_TIMEKEEPER_OVERTIME_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_TIMEKEEPER_OVERTIME_Get(Guid TimeKeeperTableListID, String EmployeeCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_TIMEKEEPER_OVERTIME_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@TimeKeeperTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.SelectCommand.Prepare();
				SqlGuid TimeKeeperTableListIDSQL = TimeKeeperTableListID;
				_dbadapter.SelectCommand.Parameters["@TimeKeeperTableListID"].Value = TimeKeeperTableListIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.SelectCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_TIMEKEEPER_OVERTIME_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
	}
}
